﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace AirlineCommon
{
    public class WriteEventLog
    {
        public static void WriteLog(string logString,bool flag)
        {
            EventLog EventLog1 = new EventLog();
             if (!System.Diagnostics.EventLog.SourceExists("MySource"))
                System.Diagnostics.EventLog.CreateEventSource(
                "MySource", "DNNLog");
            EventLog1.Log = "DNNLog";
            EventLog1.Source = "MySource";
            if (flag)
            {
                EventLog1.WriteEntry(logString, EventLogEntryType.SuccessAudit);
            }
            else
            {
                EventLog1.WriteEntry(logString, EventLogEntryType.Error);
            }
        }
       

    }
}
